package com.example.reflect.springannotation.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum StrategyEnum {
    INEDX("index","com.example.reflect.springannotation.entity.IndexEntity","com.example.reflect.springannotation.scheduler.IndexScheduler"),
    ACTIVITY("activity","com.example.reflect.springannotation.entity.ActivityEntity","com.example.reflect.springannotation.scheduler.ActivityScheduler");

    private String key;
    private String modelClassPath;
    private String strategyClassPath;



    public static StrategyEnum getEnum(String key) {
        if (null == key || "".equals(key)) {
            return null;
        }
        for (StrategyEnum value : StrategyEnum.values()) {
            if (value.key.equals(key)) {
                return value;
            }
        }
        return null;
    }
}
